window.addEvent('load',function()
{
    //斑马表
    var list=new ZebraTable(document.getElementById('List'));
    {
        list.Color_1='#ffffff';
        list.Color_2='#f6f6f6';
        list.Color_3='#ebeff9';
        list.Render('tbody');
    }
    list=null;

    //全选
    $$('#SelectAll').addEvent('click',function(){
        Checkbox.SelectAll('ID');
    });

    //全不选
    $$('#UnSelectAll').addEvent('click',function(){
        Checkbox.UnSelectAll('ID');
    });

    //删除
    $$('#Delete').addEvent('click',function()
    {
        if(Checkbox.IsChecked('ID'))
        {
            mconfirm
            (
                '你确认要删除吗？',
                function()
                {
			  $('Form1').action='list.action.batch_delete.php';
                    $('Form1').submit();
                },
                function()
                {

                }
            );
        }
        else
        {
            malert('请选择要删除的观察信息');
        }
    });
    
    //添加
     $$('#LinkAdd').addEvent('click',function()
    {
        if($('Name_Add').value=='')
        {
		malert('标题不能为空');	  
        }
        else if($('URL_Add').value=='')
        {
            malert('网址不能为空');
        }
	  else
	  {
		$('Form1').action='add.action.php';
            $('Form1').submit();  
	  }
    });
    
});

function Edit(ID)
{
	var Names=$('Name_'+ID).value;
	var URLs=$('URL_'+ID).value;
	window.location='edit.action.php?id='+ID+'&name='+Names+'&url='+URLs;       
}